/*
 * @Author: author
 * @Date:   2020-08-23 22:15:56
 * @Last Modified by:   Development
 * @Last Modified time: 2020-08-24 23:42:52
 */
import { IRes } from '@/api/core'

export interface IMethod {
  /** HTTP 请求 OPTIONS */
  OPTIONS
  /** HTTP 请求 GET */
  GET
  /** HTTP 请求 HEAD */
  HEAD
  /** HTTP 请求 POST */
  POST
  /** HTTP 请求 PUT */
  PUT
  /** HTTP 请求 DELETE */
  DELETE
  /** HTTP 请求 TRACE */
  TRACE
  /** HTTP 请求 CONNECT */
  CONNECT
}

/** 后台 响应 header 信息 */
export interface IResHeader {
  'Access-Control-Allow-Methods': string // GET,POST,OPTIONS,PUT,DELETE
  Connection: string // keep-alive
  'Content-Type': string // application/json
  Date: string // Fri, 07 Aug 2020 14:52:06 GMT
  'Keep-Alive': string // timeout=60
  'Transfer-Encoding': string // chunked

  'Access-control-Allow-Origin'?: string // http://127.0.0.1:58733
  'Access-Control-Expose-Headers'?: string // authorization
  authorization?: string // eyJhbGciOiJIUzI1NiJ9.eyJzdWIi...
  /** 苹果 手机 返回的 大写 A 开头 */
  Authorization?: string // eyJhbGciOiJIUzI1NiJ9.eyJzdWIi...
}

/** 后台 响应 data 数据信息 */
export interface IResData<D> extends IRes {
  data: D
}
